<?php
namespace BP\Sys;

use BP\En\EntityMyPK;

require_once("BP/En/Map.php");
class EnVer extends EntityMyPK {
	public function getNo () 
	{
		return $this->GetValStrByKey(EnVerAttr::$No);
	}
	public function setNo ($value) // [String value]
	{
		$this->SetValByKey(EnVerAttr::$No, $value);
	}
	public function getName () 
	{
		return $this->GetValStrByKey(EnVerAttr::$Name);
	}
	public function setName ($value) // [String value]
	{
		$this->SetValByKey(EnVerAttr::$Name, $value);
	}
	public function getEVer () 
	{
		return $this->GetValIntByKey(EnVerAttr::$EVer);
	}
	public function setEVer ($value) // [int value]
	{
		$this->SetValByKey(EnVerAttr::$EVer, $value);
	}
	public function getRec () 
	{
		return $this->GetValStrByKey(EnVerAttr::$Rec);
	}
	public function setRec ($value) // [String value]
	{
		$this->SetValByKey(EnVerAttr::$Rec, $value);
	}
	public function getRDT () 
	{
		return $this->GetValStrByKey(EnVerAttr::$RDT);
	}
	public function setRDT ($value) // [String value]
	{
		$this->SetValByKey(EnVerAttr::$RDT, $value);
	}
	public function getPKValue () 
	{
		return $this->GetValStrByKey(EnVerAttr::$PKValue);
	}
	public function setPKValue ($value) // [String value]
	{
		$this->SetValByKey(EnVerAttr::$PKValue, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenForSysAdmin();
		return $uac;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map();
		$map->setEnDBUrl(new DBUrl($DBUrlType->AppCenterDSN));
		$map->setPhysicsTable("Sys_EnVer");
		$map->Java_SetEnType($EnType->Admin);
		$map->setEnDesc("实体版本�?");
		$map->Java_SetDepositaryOfEntity($Depositary->Application);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->IndexField = EnVerAttr::$EVer;
		$map->AddMyPK();
		$map->AddTBString(EnVerAttr::$No, NULL, "实体�?",  TRUE ,  FALSE , 1, 50, 20);
		$map->AddTBString(EnVerAttr::$Name, NULL, "实体�?",  TRUE ,  FALSE , 0, 100, 30);
		$map->AddTBString(EnVerAttr::$PKValue, NULL, "主键�?",  TRUE ,  TRUE , 0, 300, 100);
		$map->AddTBInt(EnVerAttr::$EVer, 1, "版本�?",  TRUE ,  TRUE );
		$map->AddTBString(EnVerAttr::$Rec, NULL, "修改�?",  TRUE ,  TRUE , 0, 100, 30);
		$map->AddTBDateTime(EnVerAttr::$RDT, NULL, "修改日期",  TRUE ,  TRUE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function beforeInsert () 
	{
		$this->SetValByKey("MyPK", (($this->getNo() . "_") . $this->getPKValue()));
		return parent->beforeInsert();
	}
}
?>
